package com.fbproject;

import java.util.ArrayList;
import java.util.List;


import android.app.ListActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageButton;

import com.facebook.UiLifecycleHelper;

public class SearchFragment extends ListActivity {
	PAdapter adapter;
	List<Item> myListItems = null;
	
	private UiLifecycleHelper uiHelper;
	EditText edtSearch ;
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View view = inflater.inflate(R.layout.search_fragment, container, false);
		
		edtSearch = (EditText) view.findViewById(R.id.edt_search);
		
		ImageButton del = (ImageButton) view.findViewById(R.id.btmDel);
		del.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				edtSearch.setText("");
				edtSearch.clearFocus();
			}
		});
		
		myListItems = new ArrayList<Item>();
		myListItems.add(new Item("123", "My friends"));
		myListItems.add(new Item("123", "My friends's friends"));
		myListItems.add(new Item("123", "My friends's photos"));
		setView();
		
		
		
		return view;
	}
	
	private void setView(){
		adapter = new PAdapter(this, R.layout.item, myListItems);
		//methode of ListActivity
		this.setListAdapter(adapter);

	}
	
	
}
